FROM registry.cn-shenzhen.aliyuncs.com/tencreat/openjdk:8-jdk
COPY base-im-start/target/*.jar app.jar
EXPOSE 10001 10002
ARG ACTIVE_PROFILE=dev
ENV ACTIVE_ENV=$ACTIVE_PROFILE
#ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dserver.port=6060","-Dspring.profiles.active=$ACTIVE_ENV","-jar","app.jar"]
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone
# 解决服务器发送邮件发送失败问题
RUN cp /usr/local/openjdk-8/jre/lib/security/java.security /usr/local/openjdk-8/jre/lib/security/java.security.bak
RUN sed -i 's/jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1,/jdk.tls.disabledAlgorithms=/g' /usr/local/openjdk-8/jre/lib/security/java.security
# sh -c 后面才能访问到变量， 否则无法访问到变量
ENTRYPOINT ["sh","-c","java -Djava.security.egd=file:/dev/./urandom -Dserver.port=10001 -Dim.port=10002 -Dspring.profiles.active=$ACTIVE_ENV -jar app.jar"]